package com.member.common.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author wangxin
 */
@Getter
public enum EnableStatusEnum {
    /**
     * 不显示
     */
    NO_ENABLE(1, "不显示"),

    /**
     * 显示
     */
    ENABLE( 0, "显示"),
    ;

    private final Integer key;
    private final String desc;

    EnableStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static EnableStatusEnum getByKey(Integer key){
        for (EnableStatusEnum item : EnableStatusEnum.values()){
            if(Objects.equals(item.getKey(), key)){
                return item;
            }
        }
        return null;
    }

}
